/**
 * 
 */
package com.hs.dict.dao.imp;

import java.util.Map;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.hs.core.dao.impl.BaseDao;
import com.hs.core.utils.PageParam;
import com.hs.core.utils.PageQuery;
import com.hs.core.utils.PageUtil;
import com.hs.dict.dao.IDictDao;

/**
 * @author shl
 *
 * Dec 9, 2010
 */
@Repository 
public class DictDao extends BaseDao implements IDictDao{
	 
	 
	public PageUtil getDictList(PageParam pageParam) {
		PageQuery pq = new PageQuery(pageParam);
		Query query = null;
		query = this.getSession().createQuery(pageParam.getSearchSql());
		Map map =pageParam.getConditionMap();  
		int i = 0;
		if(map.containsKey("dictname"))
		{     
			query.setString(i++, "%"+(String)map.get("dictname")+"%");
		} 
		 
		PageUtil pu = pq.getPageUtil(query);

		return pu;
	}

	 
}
